function F5(){
	var worktime = getWorkTimeOut();
	$("td.today").append("<p class='work-time' style='color: red;'><i class='smallround' style='background-color: red;'></i>下班时间为: " + worktime.hours + ":" + worktime.minutes + "</p>");
	setInterval(function() {
		var status = leftTimer(parseInt(worktime.hours), parseInt(worktime.minutes), 59);
		console.info(status)
		$("td.today p.work-timer").remove();
		$("td.today").append("<p class='work-timer'><i class='smallround' style='background-color: blue;'></i>倒计时: " + (status.hours) + "时" + (status.minutes) + "分" + (status.seconds) + "秒" + "</p>");
	}, 1000);
}

function getWorkTimeOut() {
	var str = $(".today").text();
	var arr = str.match(/(\d+):(\d+)/);
	$("td.today p.work-time").remove();
	if (arr.length == 3) {
		var h = parseInt(arr[1]) + 9;
		var m = arr[2];
	   return {
		  hours:h,
		  minutes:m
	   };
    }
}

function leftTimer(hour, minute, second) {
	var now = new Date();
	var year = now.getFullYear();
	var month = now.getMonth();
	var day = now.getDate();
	console.info('倒计时:' + hour + ':' + minute + ':' + second)
	var leftTime = (new Date(year, month, day, hour, minute, second)) - (new Date()); //计算剩余的毫秒数 
	var days = parseInt(leftTime / 1000 / 60 / 60 / 24, 10); //计算剩余的天数 
	var hours = parseInt(leftTime / 1000 / 60 / 60 % 24, 10); //计算剩余的小时 
	var minutes = parseInt(leftTime / 1000 / 60 % 60, 10); //计算剩余的分钟 
	var seconds = parseInt(leftTime / 1000 % 60, 10); //计算剩余的秒数 
	days = checkTime(days);
	hours = checkTime(hours);
	minutes = checkTime(minutes);
	seconds = checkTime(seconds);

	return {
		days: days,
		hours: hours,
		minutes: minutes,
		seconds: seconds
	};
}

function checkTime(i) { //将0-9的数字前面加上0，例1变为01 
	if (i == 0) return 0;
	if (i < 0) return i;
	return ~i;
}
//F5();